#include<iostream>
#include<cmath>

using namespace std;

int main(){
	double r1, p1, r2, p2;
	cin >> r1 >> p1 >> r2 >> p2;
	double a = r1 * r2*(cos(p1)*cos(p2)-sin(p1)*sin(p2));
	double b = r1 * r2*(cos(p1)*sin(p2) + sin(p1)*cos(p2));
	if (a<0 && a>-0.005)
		printf("0.00");
	else
		printf("%.2f", a);
	
	if (b<0 && b>-0.005)
		printf("+0.00i");
	else if(b>=0)
			printf("+%.2fi", b);
		else
			printf("%.2fi", b);

}